<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>H5应用测试</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            max-width: 800px;
            margin: 0 auto;
            padding: 20px;
            background-color: #f5f5f5;
        }
        .container {
            background: white;
            padding: 30px;
            border-radius: 10px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }
        .status {
            padding: 15px;
            margin: 10px 0;
            border-radius: 5px;
            font-weight: bold;
        }
        .success {
            background-color: #d4edda;
            color: #155724;
            border: 1px solid #c3e6cb;
        }
        .error {
            background-color: #f8d7da;
            color: #721c24;
            border: 1px solid #f5c6cb;
        }
        .info {
            background-color: #d1ecf1;
            color: #0c5460;
            border: 1px solid #bee5eb;
        }
        .config-item {
            margin: 10px 0;
            padding: 10px;
            background-color: #f8f9fa;
            border-radius: 5px;
            font-family: monospace;
        }
        .btn {
            display: inline-block;
            padding: 10px 20px;
            background-color: #007bff;
            color: white;
            text-decoration: none;
            border-radius: 5px;
            margin: 5px;
        }
        .btn:hover {
            background-color: #0056b3;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>H5应用测试页面</h1>
        
        <div class="status success">
            ✅ Laravel应用运行正常
        </div>
        
        <div class="status info">
            📱 当前时间: {{ date('Y-m-d H:i:s') }}
        </div>
        
        <h2>微信配置信息</h2>
        <div class="config-item">
            <strong>AppID:</strong> {{ config('wechat.app_id') }}
        </div>
        <div class="config-item">
            <strong>Token:</strong> {{ config('wechat.token') }}
        </div>
        <div class="config-item">
            <strong>当前URL:</strong> {{ request()->url() }}
        </div>
        
        <h2>测试链接</h2>
        <a href="/h5" class="btn">访问H5应用</a>
        <a href="/wechat-test" class="btn">微信配置测试</a>
        <a href="/h5/wechat/config" class="btn">微信JS-SDK配置</a>
        
        <h2>系统信息</h2>
        <div class="config-item">
            <strong>Laravel版本:</strong> {{ app()->version() }}
        </div>
        <div class="config-item">
            <strong>PHP版本:</strong> {{ PHP_VERSION }}
        </div>
        <div class="config-item">
            <strong>服务器:</strong> {{ request()->server('SERVER_SOFTWARE', 'Unknown') }}
        </div>
        
        <h2>环境检查</h2>
        <div class="status {{ file_exists(base_path('.env')) ? 'success' : 'error' }}">
            {{ file_exists(base_path('.env')) ? '✅ .env文件存在' : '❌ .env文件不存在' }}
        </div>
        <div class="status {{ config('wechat.app_id') ? 'success' : 'error' }}">
            {{ config('wechat.app_id') ? '✅ 微信AppID已配置' : '❌ 微信AppID未配置' }}
        </div>
        <div class="status {{ is_dir(public_path('static/h5')) ? 'success' : 'error' }}">
            {{ is_dir(public_path('static/h5')) ? '✅ H5静态文件目录存在' : '❌ H5静态文件目录不存在' }}
        </div>
    </div>
</body>
</html>
